package com.cmcc.aregister.ui.dialog;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.cmcc.aregister.R;
import com.cmcc.aregister.cs.constant.ConfigUtilHelper;
import com.cmcc.aregister.cs.model.MemberModel;

public class MemberInfoDialog extends MyDialog {
    private Button confirm;

    public MemberInfoDialog(Context context, MemberModel member) {
        super(context);
        setContentView(R.layout.dialog_member_info);
        ((TextView) findViewById(R.id.dialog_member_name)).setText(member.truename);
        ((TextView) findViewById(R.id.dialog_member_relation)).setText(ConfigUtilHelper.getRelationText(context,member.relation,member.sex));
        ((TextView) findViewById(R.id.dialog_member_sex)).setText(member.sex == 0 ? "男" : "女");
        ((TextView) findViewById(R.id.dialog_member_birth)).setText(member.birth);
        ((TextView) findViewById(R.id.dialog_member_idcard)).setText(member.card);
        ((TextView) findViewById(R.id.dialog_member_sscard)).setText(member.social_card);
        confirm = (Button) findViewById(R.id.dialog_confirm_btn);

        confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }



    public void setCancelClickListener(View.OnClickListener onClickListener) {
        confirm.setOnClickListener(onClickListener);
    }
}
